using Headsight.BPMN2WF.Testing.TestObjCtors;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Headsight.BPMN2WF.Testing.TestObjCtorsTest
{
    [TestClass]
    public class BPMNShapeCtorTest
    {
        private BPMNShapeCtor _sut;

        [TestInitialize]
        public void SetUp()
        {
            _sut = new BPMNShapeCtor();
        }

        [TestMethod]
        public void Create()
        {
            var actual = _sut.Create();

            Assert.IsNotNull(actual);

            var bounds = actual.Bounds;
            Assert.IsNotNull(bounds);
            Assert.AreEqual(1, bounds.x);
            Assert.AreEqual(2, bounds.y);
            Assert.AreEqual(3, bounds.width);
            Assert.AreEqual(4, bounds.height);
        }

        [TestMethod]
        public void WithForBPMNElementHavingId_is_chaining()
        {
            Assert.AreSame(_sut, _sut.WithForBPMNElementHavingId("**id**"));
        }

        [TestMethod]
        public void WithForBPMNElementHavingId_Create()
        {
            var actual = _sut.WithForBPMNElementHavingId("**id**").Create();

            Assert.AreEqual("**id**", actual.bpmnElement.Name);
        }
    }
}